{{response.files.insert(4, 'https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js')}}
{{response.files.insert(6, URL(request.application,'static','lightface/LightFace.js'))}}
{{response.files.insert(7, URL(request.application,'static','lightface/LightFace.css'))}}
{{extend 'mylayout.html'}}

{{=DIV(DIV(IMG(_src=pic, _height=200)),
DIV(P(B('You are %s.' % name)),
P(description)), _id='quiz_result')}}
<div id="friendResultWrap">
</div>
<script>
    function PublishResultFunction() {
        box = new LightFace({
            title: 'Quiz Result',
            width: 480,
            height: 150,
            content: '{{=DIV(DIV(IMG(_src=pic), _id="result_picture"), DIV(P(B("You are %s" % name)), P(description), _id="result_text"), _id="result_wrapper")}}',
            buttons:[
                {
                    title: 'Publish',
                    event: function() {
                        var publishResultRequest = new Request({
                            url: '{{=URL('default', 'publishResult')}}',
                        });
                        publishResultRequest.send();
                        this.close();
                    },
                    color: 'blue',
                },
                {
                    title: 'Skip',
                    event: function() {this.close();},
                }
            ]
        });
        box.open();
        $("#friendResultWrap").load('{{=URL('getFriendUsersResultWrapper')}}');
    }
    $(document).ready(function(){
        PublishResultFunction();
    });
</script>
